home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-19 | 3.0 KB | 88 lines | [TEXT/MPS ] |
- Read the "Help XFCN RN x.x" release notes first.
-
- The following is an overview of the help XFCN code operation.
- See the source files for more detailed information.
-
- 12-03-90 1.0d3 JRP initial creation of these notes
-
- John R. Powers, III
- GFX Group
- Instructional Products Department
- Apple Computer, Inc.
- 408-974-9851 (Apple office)
- 408-395-1158 (Home office)
- AppleLink: JohnPowers
-
- Files
-
- buildHelp sets up and executes the make
- help.c This source file
- help.r Rez source
- gfun.c source for using HyperCard globals
- gfun.pro prototypes for gfun.c
- trap.c source for using Gestalt
- trap.pro prototypes for trap.c
- vers.h header with version information
- makefileHelp make file
- helpLab HyperCard stack for testing
-
- buildHelp sets up the MPW shell variables used in
- makefileHelp and executes the make. To build the
- XFCN, do the following:
-
- (1) Setup the folder and files as described below.
- (2) Execute "buildHelp <path to Help folder>" from the MPW worksheet.
-
- The entrypoint is in help.c. This file contains the
- functions that are specific to help and some general
- utilities for interfacing with HyperCard.
-
- gfun.c contains a set of utility functions for using
- HyperCard globals. These functions do the callbacks
- to HyperCard and the translation of the handle to
- a global-useable form.
-
- trap.c is a library of functions for using Gestalt.
- It contains the 3.1 (not 3.2) method to test for
- Gestalt as well as application-specific tests (like
- testing for the Help Manager.) This file is expanded
- as we add more Gestalt tests.
-
- Operation Overview
-
- All strings are stored in a STR# named "help". Since
- we want to use the GetIndString, we first lookup the
- STR# by name to get its resource number. The resource
- number, strResId, is then used throughout the XFCN to
- reference the STR# resource.
-
- Test for version and help commands first. All other
- commands require the Help Manager. If it is not a
- version or help command, we make sure the Help Manager
- is present.
-
- Make note of the current state of help (helpEnabled)
- so that we can restore that state when we exit the XFCN.
- If needed, we enable help.
-
- Pick off the parameters following the command and convert
- them to a form that can be used by the Help Manager. The
- fourth and last parameter is the optional alternativeRect
- or hotRect.
-
- Use of alternativeRect/hotRect
-
- An area on the heap is saved to store the alternativeRect
- (also called hotRect). The handle to this area is stored
- as a HyperCard Global whose name is stored in globalNamePstr.
- When the XFCN is called, a test is made to see if the
- global has anything in it. If it does, then that is the
- handle used for storing the hotRect. If it doesn't, then
- a new handle is created and stored in the global.
-
- If the hotRect parameter is present, it is converted from
- a comma-delimited string to a Rect. The rect is stored on
- the heap, referenced by the handle stored in the HyperCard
- global. The handle is locked and dereferenced to a pointer.
- The pointer is passed to the Help Manager.
-